//
//  BaseTableViewDelegateMediator.m
//  DailyRecord
//
//  Created by Gin on 2022/3/29.
//

#import "BaseTableViewDelegateMediator.h"

@interface BaseTableViewDelegateMediator ()

@property (nonatomic, copy, readwrite) NSArray<id> *dataSource;

@end

@implementation BaseTableViewDelegateMediator

- (instancetype)initWithDataSource:(NSArray<id> *)dataSource{
    if (self = [super init]) {
        self.dataSource = dataSource;
    }
    return self;
}

- (void)updateDataSource:(NSArray<id> *)dataSource{
    self.dataSource = dataSource;
}

- (void)addDataSource:(NSArray<id> *)dataSource{
    NSMutableArray *ds = [NSMutableArray arrayWithArray:self.dataSource];
    [ds addObjectsFromArray:dataSource];
    self.dataSource = ds;
}

@end
